﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract Konto typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class KontoDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<KontoDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.Konto _currentKonto = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxKontoDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxKontoErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxKontoBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Sifra property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxSifraDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Naziv property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNazivDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Analiticki property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxAnalitickiDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDTip property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDTipDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IDKontoPoreza property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDKontoPorezaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumOd property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumOdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumDo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumDoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PrijenosAnaliticki property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxPrijenosAnalitickiDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.TipKonta> _IDTipList;
		
		/// <summary> 
		/// The list of selectable TipKonta
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.TipKonta> IDTipList
		{
			get {return this._IDTipList;}
			set 
			{
				this._IDTipList = value;
				this.uxIDTipDataGridViewColumn.DataSource = null;
				this.uxIDTipDataGridViewColumn.DataSource = this._IDTipList;
			}
		}
		
		private bool _allowNewItemInIDTipList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of TipKonta
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDTipList
		{
			get { return _allowNewItemInIDTipList;}
			set
			{
				this._allowNewItemInIDTipList = value;
				this.uxIDTipDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.Konto> _KontoList;
				
		/// <summary> 
		/// The list of Konto to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.Konto> KontoList
		{
			get {return this._KontoList;}
			set
			{
				this._KontoList = value;
				this.uxKontoBindingSource.DataSource = null;
				this.uxKontoBindingSource.DataSource = value;
				this.uxKontoDataGridView.DataSource = null;
				this.uxKontoDataGridView.DataSource = this.uxKontoBindingSource;				
				//this.uxKontoBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxKontoBindingSource_ListChanged);
				this.uxKontoBindingSource.CurrentItemChanged += new System.EventHandler(OnKontoBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnKontoBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentKonto = uxKontoBindingSource.Current as Entities.Konto;
			
			if (_currentKonto != null)
			{
				_currentKonto.Validate();
			}
			//_Konto.Validate();
			OnCurrentEntityChanged();
		}

		//void uxKontoBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.Konto"/> instance.
		/// </summary>
		public Entities.Konto SelectedKonto
		{
			get {return this._currentKonto;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxKontoDataGridView.VirtualMode;}
			set
			{
				this.uxKontoDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxKontoDataGridView.AllowUserToAddRows;}
			set {this.uxKontoDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxKontoDataGridView.AllowUserToDeleteRows;}
			set {this.uxKontoDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxKontoDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxKontoDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="KontoDataGridViewBase"/> class.
		/// </summary>
		public KontoDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxKontoDataGridView = new System.Windows.Forms.DataGridView();
			this.uxKontoBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxKontoErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxSifraDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNazivDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxAnalitickiDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxIDTipDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDKontoPorezaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumOdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumDoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPrijenosAnalitickiDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			//this.uxIDTipBindingSource = new TipKontaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDTipBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKontoDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKontoBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKontoErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxKontoErrorProvider
			// 
			this.uxKontoErrorProvider.ContainerControl = this;
			this.uxKontoErrorProvider.DataSource = this.uxKontoBindingSource;						
			// 
			// uxKontoDataGridView
			// 
			this.uxKontoDataGridView.AutoGenerateColumns = false;
			this.uxKontoDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxKontoDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxSifraDataGridViewColumn,
		this.uxNazivDataGridViewColumn,
		this.uxAnalitickiDataGridViewColumn,
		this.uxIDTipDataGridViewColumn,
		this.uxIDKontoPorezaDataGridViewColumn,
		this.uxDatumOdDataGridViewColumn,
		this.uxDatumDoDataGridViewColumn,
		this.uxPrijenosAnalitickiDataGridViewColumn			});
			this.uxKontoDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxKontoDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxKontoDataGridView.Name = "uxKontoDataGridView";
			this.uxKontoDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxKontoDataGridView.TabIndex = 0;	
			this.uxKontoDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxKontoDataGridView.EnableHeadersVisualStyles = false;
			this.uxKontoDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnKontoDataGridViewDataError);
			this.uxKontoDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnKontoDataGridViewCellValueNeeded);
			this.uxKontoDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnKontoDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxSifraDataGridViewColumn
			//
			this.uxSifraDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxSifraDataGridViewColumn.DataPropertyName = "Sifra";
			this.uxSifraDataGridViewColumn.HeaderText = "Sifra";
			this.uxSifraDataGridViewColumn.Name = "uxSifraDataGridViewColumn";
			this.uxSifraDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxSifraDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxSifraDataGridViewColumn.ReadOnly = false;		
			//
			// uxNazivDataGridViewColumn
			//
			this.uxNazivDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNazivDataGridViewColumn.DataPropertyName = "Naziv";
			this.uxNazivDataGridViewColumn.HeaderText = "Naziv";
			this.uxNazivDataGridViewColumn.Name = "uxNazivDataGridViewColumn";
			this.uxNazivDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNazivDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNazivDataGridViewColumn.ReadOnly = false;		
			//
			// uxAnalitickiDataGridViewColumn
			//
			this.uxAnalitickiDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxAnalitickiDataGridViewColumn.DataPropertyName = "Analiticki";
			this.uxAnalitickiDataGridViewColumn.HeaderText = "Analiticki";
			this.uxAnalitickiDataGridViewColumn.Name = "uxAnalitickiDataGridViewColumn";
			this.uxAnalitickiDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxAnalitickiDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxAnalitickiDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDTipDataGridViewColumn
			//
			this.uxIDTipDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDTipDataGridViewColumn.DataPropertyName = "IDTip";
			this.uxIDTipDataGridViewColumn.HeaderText = "IDTip";
			this.uxIDTipDataGridViewColumn.Name = "uxIDTipDataGridViewColumn";
			this.uxIDTipDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDTipDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDTipDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDKontoPorezaDataGridViewColumn
			//
			this.uxIDKontoPorezaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDKontoPorezaDataGridViewColumn.DataPropertyName = "IDKontoPoreza";
			this.uxIDKontoPorezaDataGridViewColumn.HeaderText = "IDKontoPoreza";
			this.uxIDKontoPorezaDataGridViewColumn.Name = "uxIDKontoPorezaDataGridViewColumn";
			this.uxIDKontoPorezaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDKontoPorezaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDKontoPorezaDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumOdDataGridViewColumn
			//
			this.uxDatumOdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumOdDataGridViewColumn.DataPropertyName = "DatumOd";
			this.uxDatumOdDataGridViewColumn.HeaderText = "DatumOd";
			this.uxDatumOdDataGridViewColumn.Name = "uxDatumOdDataGridViewColumn";
			this.uxDatumOdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumOdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumOdDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumDoDataGridViewColumn
			//
			this.uxDatumDoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumDoDataGridViewColumn.DataPropertyName = "DatumDo";
			this.uxDatumDoDataGridViewColumn.HeaderText = "DatumDo";
			this.uxDatumDoDataGridViewColumn.Name = "uxDatumDoDataGridViewColumn";
			this.uxDatumDoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumDoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumDoDataGridViewColumn.ReadOnly = false;		
			//
			// uxPrijenosAnalitickiDataGridViewColumn
			//
			this.uxPrijenosAnalitickiDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPrijenosAnalitickiDataGridViewColumn.DataPropertyName = "PrijenosAnaliticki";
			this.uxPrijenosAnalitickiDataGridViewColumn.HeaderText = "PrijenosAnaliticki";
			this.uxPrijenosAnalitickiDataGridViewColumn.Name = "uxPrijenosAnalitickiDataGridViewColumn";
			this.uxPrijenosAnalitickiDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPrijenosAnalitickiDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPrijenosAnalitickiDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDTipDataGridViewColumn
			//				
			this.uxIDTipDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDTipDataGridViewColumn.ValueMember = "ID";	
			this.uxIDTipDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDTipDataGridViewColumn.DataSource = uxIDTipBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxKontoDataGridView);
			this.Name = "KontoDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDTipBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKontoErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKontoDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKontoBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				KontoDataGridViewEventArgs args = new KontoDataGridViewEventArgs();
				args.Konto = _currentKonto;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class KontoDataGridViewEventArgs : System.EventArgs
		{
			private Entities.Konto	_Konto;
	
			/// <summary>
			/// the  Entities.Konto instance.
			/// </summary>
			public Entities.Konto Konto
			{
				get { return _Konto; }
				set { _Konto = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxKontoDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnKontoDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxKontoDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnKontoDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxKontoDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = KontoList[e.RowIndex].ID;
						break;
					case "uxSifraDataGridViewColumn":
						e.Value = KontoList[e.RowIndex].Sifra;
						break;
					case "uxNazivDataGridViewColumn":
						e.Value = KontoList[e.RowIndex].Naziv;
						break;
					case "uxAnalitickiDataGridViewColumn":
						e.Value = KontoList[e.RowIndex].Analiticki;
						break;
					case "uxIDTipDataGridViewColumn":
						e.Value = KontoList[e.RowIndex].IDTip;
						break;
					case "uxIDKontoPorezaDataGridViewColumn":
						e.Value = KontoList[e.RowIndex].IDKontoPoreza;
						break;
					case "uxDatumOdDataGridViewColumn":
						e.Value = KontoList[e.RowIndex].DatumOd;
						break;
					case "uxDatumDoDataGridViewColumn":
						e.Value = KontoList[e.RowIndex].DatumDo;
						break;
					case "uxPrijenosAnalitickiDataGridViewColumn":
						e.Value = KontoList[e.RowIndex].PrijenosAnaliticki;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxKontoDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnKontoDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxKontoDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						KontoList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxSifraDataGridViewColumn":
						KontoList[e.RowIndex].Sifra = (System.String)e.Value;
						break;
					case "uxNazivDataGridViewColumn":
						KontoList[e.RowIndex].Naziv = (System.String)e.Value;
						break;
					case "uxAnalitickiDataGridViewColumn":
						KontoList[e.RowIndex].Analiticki = (System.Boolean)e.Value;
						break;
					case "uxIDTipDataGridViewColumn":
						KontoList[e.RowIndex].IDTip = (System.Int32)e.Value;
						break;
					case "uxIDKontoPorezaDataGridViewColumn":
						KontoList[e.RowIndex].IDKontoPoreza = (System.Int32?)e.Value;
						break;
					case "uxDatumOdDataGridViewColumn":
						KontoList[e.RowIndex].DatumOd = (System.DateTime)e.Value;
						break;
					case "uxDatumDoDataGridViewColumn":
						KontoList[e.RowIndex].DatumDo = (System.DateTime?)e.Value;
						break;
					case "uxPrijenosAnalitickiDataGridViewColumn":
						KontoList[e.RowIndex].PrijenosAnaliticki = (System.Boolean?)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
